﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Database.Models
{
    [Table("PhanLoaiChiTietPhuongTienPCCCCoSo")]
    public class PhanLoaiChiTietPhuongTienPCCCCoSo : BaseModel
    {
        public PhanLoaiChiTietPhuongTienPCCCCoSo()
        {
            PhuongTienCoSoes = new HashSet<PhuongTienCoSo>();
        }

        public int Id { get; set; }

        [Required]
        [MaxLength(255)]
        public string Ten { get; set; }

        [NotMapped]
        public virtual string NhomPhuongTienCoSo
        {
            get
            {
                if (NhomPhuongTienCoSoes != null)
                {
                    return NhomPhuongTienCoSoes.Ten;
                }
                return string.Empty;
            }
        }

        public virtual NhomPhuongTienPCCCCoSo NhomPhuongTienCoSoes { get; set; }

        public ICollection<PhuongTienCoSo> PhuongTienCoSoes { get; set; }
    }
}
